<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-热门关键字管理">
</@frame.head>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/search_table.css" />
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 促销管理 <span class="c-gray en">&gt;</span> 热门关键字管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
   <div class="text-c">
    <form action="${contextPath}/hot_key_words/query_hot_key_words_list" method="post" name="search_form" id="search_form">
        <input type="hidden" name="page" value="${pagination.pageNo}"  id="page" />
        <table class="table search_table" >
          <tr>  
           <td  width="60px">关键字名称：</td>
           <td  width="200px"><input type="text" class="input-text  radius"  placeholder="请输入关键字名称" name="keyWords" value="${hotKeyWordsQo.keyWords}" >
           </td> 
           
           <td>上架时间：</td>
           <td><input  type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'endStartDate\')}',readOnly: true })" id="startTime" 
               value='${(hotKeyWordsQo.startTime?string("yyyy-MM-dd"))!}' name="startTime"  class="input-text Wdate" style="width:45%;">
                                                至
               <input  type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'startTime\')}',readOnly: true })" id="endStartDate" 
               value='${(hotKeyWordsQo.endStartDate?string("yyyy-MM-dd"))!}' name=endStartDate    class="input-text Wdate" style="width:45%;">
           </td>
           
           <td>下架时间：</td>
           <td><input  type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'endTime\')}',readOnly: true })" id="beginEndDate" 
               value='${(hotKeyWordsQo.beginEndDate?string("yyyy-MM-dd"))!}' name="beginEndDate"  class="input-text Wdate" style="width:45%;">
                                                至
               <input  type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'beginEndDate\')}',readOnly: true })" id="endTime" 
               value='${(hotKeyWordsQo.endTime?string("yyyy-MM-dd"))!}' name="endTime"    class="input-text Wdate" style="width:45%;">
           </td>
           </tr>
           <tr>
           <td>状态：</td>
           <td>
             <span class="select-box radius">
               <select class="select"  name="status" >
                 <option value>全部</option>
                  <#list statusMap?keys as key>
                 <option value="${key}" <#if key==hotKeyWordsQo.status>selected="selected"</#if>>${statusMap["${key}"]}</option> 
                  </#list>
               </select>
             </span>
           </td>   
           <td ></td>   
           <td><input class="btn btn-success radius" type="submit" value="搜索" /></td>  <td></td><td></td>
           </tr>
      </table>
     </form>
    </div>

    <div class="cl pd-5 bg-1 bk-gray mt-20"> 
    <span class="l">
    <a href="javascript:;" onclick="addWords();" class="btn btn-primary radius"> 添加新关键字</a> 
    </span>
    <span class="r">共有数据：<strong>${pagination.totalCount}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr  class="text-c">
            <th >热门关键字</th>
            <th >上架时间</th>
            <th >下架时间</th>
            <th >发布时间</th>
            <th >点击量</th>
            <th >状态</th>
            <th >操作</th>
        </tr>
        </thead>
        <tbody >
         <#list pagination.list as list> 
         <tr  class="text-c">
            <td>${list.keyWords}</td>
            <td>${(list.startDate?string("yyyy-MM-dd"))!}</td>
            <td>${(list.endDate?string("yyyy-MM-dd"))!}</td>
            <td>${(list.pubDate?string("yyyy-MM-dd"))!}</td>
            <td>${list.clickCount}</td>
            <td>${(statusMap[list.status?trim])!}</td>
            <td>
             <#if list.status?trim=="1">  
             <a href="javascript:;" onclick="upWords('${list.id}');">上架</a>&nbsp;&nbsp;&nbsp;
            <#elseif list.status?trim=="2">
             <a href="javascript:;" onclick="downWords('${list.id}');">下架</a>&nbsp;&nbsp;&nbsp;
            </#if>
             <a href="javascript:;" onclick="deleteWords('${list.id}');">删除</a>
            </td>
         </tr>
         </#list>
        </tbody>
    </table>
    <div id="div_page" style="padding-top: 10px;float: right"></div>
</div>
</div>
<@frame.end "default">
</@frame.end>
</html>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/hot_key_words/query_hot_key_words_list.js"></script>
<script type="text/javascript">
var path="${contextPath}";
laypage({
    cont: 'div_page',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
	skip: true, //是否开启跳页
	first: 1, //将首页显示为数字1,。若不显示，设置false即可
	last: ${pagination.totalPage}, //将尾页显示为总页数。若不显示，设置false即可
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
            $("#page").val(obj.curr);
            $("#search_form").submit();
        }
    }
});

</script>